<%@ Page Language="C#" Inherits="Castle.MonoRail.Views.AspView.ViewAtDesignTime<IPostView>" %>
<%@ Import namespace="KenEgozi.Com.Weblog.Interfaces"%>
<%@ Import namespace="KenEgozi.Com.Domain.Aggregates.Tag"%>
<%@ Import namespace="KenEgozi.Com.Domain.Aggregates.Post"%>
<%@ Import namespace="KenEgozi.Com.Weblog.Helpers"%>

<div class="PostBrief">
	<%=view.DivHelper.RoundedOpenTag() %>
	<div class="Date">
		<span class="Year"><%=view.Post.Lifecycle.CreationDate.Year%></span>
		<span class="Month"><%=view.Post.Lifecycle.CreationDate.ToString("MMM")%></span>
		<span class="Day"><%=view.Post.Lifecycle.CreationDate.Day%></span>
	</div>
	<h4><a href="~/<%=view.Post.Permalink %>"><%=view.Post.Title%></a></h4>
	<div class="Tags">
		<%if (view.Post.Tags.Count > 0) { %>
		<span>tagged as:</span>
		<%bool first = true; %>
		<%foreach (Tag tag in view.Post.Tags) { %>
		<%=first ? "" : "<span>|</span>"%>
		<%if (first) first = false;%>
		<a href="~/Tag/<%=tag.UrlFriendlyName %>.aspx"><%=tag.Name%></a>
		<%} %>
		<%} else {%>
		<span>Not tagged yet</span>
		<%} %>
	</div>
	<div class="PostContent"><%=view.Post.Content%></div>
	<%string comment = "No comments yet"; %>
	<%if (view.Post.CommentCount > 0) comment = "Comments[" + view.Post.CommentCount + "]"; %>
	<div class="PostFooter">
		<div class="PostWidgets">
			<a class="PostWidget" href="http://www.dotnetkicks.com/kick/?url=~~/<%=view.Post.Permalink%>">
				<img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=~~/<%=view.Post.Permalink%>&border=000066&fgcolor=D4E1ED&bgcolor=547699&cfgcolor=000066" border="0" alt="kick it on DotNetKicks.com" />
			</a>
		</div>
		<div class="CommentsLinks">
			<a href="~/<%=view.Post.Permalink %>#commentstart"><%=comment %></a>,
			<a href="~/<%=view.Post.Permalink%>?SyndicationType=Atom">Comments feed</a>
		</div>
		<div class="Break"></div>
	</div>
	<%=view.DivHelper.RoundedCloseTag()%>
</div>